﻿<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/ShopCart/ShopCartMaster.Master" CodeBehind="ShoppingCartConfirm_bak.aspx.cs" Inherits="ZLCMS.Web.ShopCart.ShoppingCartConfirm" %>

<%@ MasterType VirtualPath="~/ShopCart/ShopCartMaster.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript" language="JavaScript">
function ts()
{
return confirm("确认提交订单吗？提交后将生成既定订单，不能修改！！");
}
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<form id="Form1" method="post" runat="server">
     <div class="childnav">
            <div class="title">
                <div class="address">
                    <a href="../Default.aspx">亨康</a>|<a href="ShoppingCart.aspx" class="other">购物车</a></div>
            </div>
        </div>
        <div class="clear">
        </div>
        <!--当前位置  end-->
        </div>
        <!--wrapper end-->
    <div class="mall">
    <div class="mrtitle" style="padding: 20px 0 5px 40px;background: url(/images/shopcart/pro_1.jpg) no-repeat scroll 0 15px transparent;">我选择的商品：
    <span style="font-size: 12px; float: right;"><a href="/ShopCart/ShoppingCart.aspx">回到购物车，修改产品 >></a></span></div>
        <!--分页 中间内容 start-->
        <div id="centent">
            <!--中间内容 start-->
            <div class="main">
                <!--购物车 start-->
                <div id="cart">
                    <div class="cart_title">
                        <span>【</span>购物车<span>】</span></div>
                    <div class="cart_box">
                        <div class="cart_left">
                            <table width="677" border="0">
                                <tr>
                                    <th colspan="2" scope="col">
                                        产品
                                    </th>
                                    <th scope="col">
                                        &nbsp;
                                    </th>
                                    <th scope="col">
                                        &nbsp;
                                    </th>
                                    <th scope="col">
                                        价格
                                    </th>
                                    <th scope="col">
                                        数量
                                    </th>
                                    <th scope="col">
                                        合计
                                    </th>
                                </tr>
                                <asp:Repeater ID="rp_productlist" runat="server" OnItemDataBound="rp_productlist_ItemDataBound">
                                    <ItemTemplate>
                                        <tr>
                                            <td>
                                                <asp:Image ID="img_product" runat="server" Width="60px" />
                                            </td>
                                            <td style="text-align: left;">
                                                <a href='/ProductView.aspx?uid=<%# Eval("ProductId") %>' target="_blank">
                                                    <asp:Label ID="lb_productname" runat="server"></asp:Label></a><p>
                                                        <a href='/ProductView.aspx?uid=<%# Eval("ProductId") %>' target="_blank">查看</a>&nbsp;|&nbsp;<a
                                                            href="javascript:void(0);" onclick="RemoveProduct(<%# Container.ItemIndex+1 %>, <%# Eval("CartId") %>);return false;">移除</a></p>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                ￥<asp:Label ID="lb_price" runat="server"></asp:Label>
                                            </td>
                                            <td>
                                                 <a href="javascript:void(0);" onclick="AddProductQuantity($(this), <%# Eval("CartId") %>,<%# Container.ItemIndex+1 %>, -1);return false;"
                                                    class="reduce">-</a>
                                                <input style="border: 1px #DDD solid; width: 20px; text-align: center;" id="txtQ<%# Container.ItemIndex+1 %>"
                                                    type="text" value='<%# Eval("Quantity") %>' onblur='UpdateProductQuantity($(this),<%# Eval("CartId") %>,<%# Container.ItemIndex+1 %>);return false;' />
                                                <a href="javascript:void(0);" onclick="AddProductQuantity($(this), <%# Eval("CartId") %> ,<%# Container.ItemIndex+1 %>,1);return false;"
                                                    class="add"><span class="img">+</span></a>
                                            </td>
                                            <td>
                                                ￥<asp:Label ID="lb_totalprice" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                                <!-- rp_productlist -->
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        小计
                                    </td>
                                    <td>
                                        <%=_totalCount %>件
                                    </td>
                                    <td>
                                        ￥<%= _totalPrice.ToString("0.00") %>
                                    </td>
                                </tr>
                            </table>
                        
                        </div>
                       <!-- <div class="cart_right">
                            <div class="cart_righttitle">
                                搭配推荐</div>

                            <ul>
                            <asp:Repeater ID="rp_recommend" runat="server">
                                    <ItemTemplate>
                                <li><a href="#">
                                    <img src="/images/cart_pic.jpg" width="60" height="60" /></a>
                                    <div class="right">
                                        <h3>
                                            欣安洁肤乳 <span>10ml</span></h3>
                                        <p>
                                            修复表皮，恢复皮肤屏障功能屏障功能屏障功能屏障功能</p>
                                        <p>
                                            ￥100</p>
                                    </div>
                                    <div class="clear">
                                    </div>
                                    <p class="go">
                                        <a href="#">[点击订购]</a></p>
                                </li>
                                </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                        </div>-->
                        <div class="clear">
                        </div>
                    </div>
                </div>
                <!--购物车 end-->
            </div>
            <!--中间内容 end-->
        </div>
        <!--分页 中间内容 end-->
    <div class="mrtitle dl_t" style="padding: 20px 0 5px 40px;background: url(/images/shopcart/cons_1.jpg) no-repeat scroll 0 15px transparent;">收货人信息：
    <span style="font-size: 12px; float: right;"><a href="/MemberUser/MyAddress.aspx">管理收货地址信息 >></a></span></div>
    
    <div class="revARadio">
        <asp:RadioButtonList ID="rbl_address" Runat="server" RepeatDirection="Horizontal" RepeatColumns="1" Width="100%"></asp:RadioButtonList>
    </div>  
    
    <div class="mrtitle dl_t" style="padding: 20px 0 5px 40px;background: url(/images/shopcart/ship_1.jpg) no-repeat scroll 0 15px transparent;">送货方式：</div>  
    <div class="revARadio">
        <asp:RadioButtonList ID="rbl_shipping" Runat="server" RepeatDirection="Horizontal" RepeatColumns="1" Width="100%"></asp:RadioButtonList>   
    </div>   
    
    <div class="mrtitle dl_t" style="padding: 20px 0 5px 40px;background: url(/images/shopcart/pay_1.jpg) no-repeat scroll 0 15px transparent;">支付方式：</div>     
    <div class="revARadio">
        <asp:RadioButtonList ID="rbl_payment" Runat="server" RepeatDirection="Horizontal" RepeatColumns="1" Width="100%"></asp:RadioButtonList>
    </div>   
    
    <div class="mrtitle dl_t" style="padding: 20px 0 5px 40px;background: url(/images/shopcart/remark_1.jpg) no-repeat scroll 0 15px transparent;">订单备注信息及其他：</div>  
    <div class="revARadio">  
        <asp:textbox id="txtRemark" runat="server" TextMode="MultiLine" style="width:350px; height:85px; overflow-y:auto;margin-left: 35px;"></asp:textbox> 
    </div>   
    
    <ul class="mrtext">
      <li class="revABtn" style="float: right;">
        <asp:Button ID="tb_commit" runat="server" Text="提交订单" OnClientClick="return ts()" onclick="tb_commit_Click"/>
      </li>
    </ul>
    <div class="clear"></div>
    </div><!-- end mall -->
</form>
         <script language="javascript" type="text/javascript">
             function RemoveProduct(ui, id, index) {
                 if (window.confirm("是否确认移除该商品？")) {
                     $this = ui;
                     var param = {};
                     param['CartId'] = id;

                     $this.executeCommand({
                         successCallBack: function (result, totalCount) {
                             alert('操作成功');
                         },
                         errorCallback: function (errorCode, msg) {
                             alert(msg);
                         }
                     }, 'RemoveProductApply', param);
                 }
             }

             function AddProductQuantity(ui, id, index, num) {
                 $this = ui;
                 var param = {};
                 var no = parseInt($("#txtQ").val()) + num;

                 param['CartId'] = id;
                 param['Num'] = num;

                 $this.executeCommand({
                     successCallBack: function (result, totalCount) {
                         $("#txtQ" + index).val(no);
                     },
                     errorCallback: function (errorCode, msg) {
                         alert(msg);
                     }
                 }, 'AddProductQuantityApply', param);
             }

             function UpdateProductQuantity(ui, id, index) {
                 var num = document.getElementById("txtQ" + index).value;
                 $this = ui;
                 var param = {};
                 param['CartId'] = id;
                 param['Num'] = num;

                 $this.executeCommand({
                     successCallBack: function (result, totalCount) {
                         $("#txtQ" + index).val(num);
                     },
                     errorCallback: function (errorCode, msg) {
                         alert(msg);
                     }
                 }, 'UpdateProductQuantityApply', param);
             }
        </script>
</asp:Content>